<h1>Listing products</h1>

<table>
  <tr>
    <th>Id</th>
    <th>Name</th>
    <th>Description</th>
    <th>Price</th>
    <th>Image</th>
    <th>Thumbnail</th>
    <th>Created on</th>
    <th>Updated on</th>
  </tr>
  
<% for product in @products %>
  <tr>
    <td><%=h product.id %></td>
    <td><%=h product.name %></td>
    <td><%=h product.description %></td>
    <td><%=h product.price %></td>
    <td><%=h product.image %></td>
    <td><%=h product.thumbnail %></td>
    <td><%=h product.created_on %></td>
    <td><%=h product.updated_on %></td>
    <td><%= link_to 'Show', product_path(product) %></td>
    <td><%= link_to 'Edit', edit_product_path(product) %></td>
    <td><%= link_to 'Destroy', product_path(product), :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New product', new_product_path %>